package test;

import java.util.Scanner;

public class col {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        //在此输入您的代码...
        int n = scan.nextInt();
        int k = scan.nextInt();
        int[][] a =new int[n][2];
        for(int i=0;i<n;i++){
            a[i][0]=scan.nextInt();
            a[i][1]=scan.nextInt();
        }
        int max=Integer.MAX_VALUE;
        int min=0;
        int ave,cut,ans=0;
        while(min<=max){
            ave=(max+min)/2;
            cut=0;
            for(int i = 0;i<n;i++){
                cut+=(a[i][0]/ave)*(a[i][1]/ave);
            }
            if(cut>=k){
                min=ave+1;
                ans=ave;
            }else{
                max=ave-1;
            }
        }
        System.out.println(ans);
        scan.close();
    }
}
